#include<iostream> 
#include<algorithm>
using namespace std;
const int maxx=1000010;
int n,mid,a[maxx];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>a[i];
	sort(a+1,a+n+1);
	if(n%2==0)
	{
		mid=a[n/2]+a[n/2+1];
		if(mid%2!=0)
		  cout<<a[n]<<" "<<mid/2<<".5"<<" "<<a[1];
		else
		  cout<<a[n]<<" "<<mid/2<<" "<<a[1];
	}
	else 
	{
		mid=a[n/2+1];
		cout<<a[n]<<" "<<mid<<" "<<a[1];
	}
	return 0;
}